package com.tmt.im.manager.controller.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serial;
import java.io.Serializable;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/9/20 22:31
 * @Version 1.0
 **/
@Getter
@Setter
@Tag(name = "好友信息VO对象", description = "好友信息VO对象")
public class UploadFileRequest implements Serializable {

    @Serial
    private static final long serialVersionUID = 4030709544743125884L;

    /**
     * 目标好友的用户ID
     */
    @Schema(requiredMode = REQUIRED, description = "上传文件类型：0-用户头像，1-群组头像，2-其他文件")
    @NotNull(message = "上传文件类型不能为null")
    @Min(value = 0, message = "上传文件类型只能是：0-用户头像，1-群组头像，2-其他文件")
    @Max(value = 2, message = "上传文件类型只能是：0-用户头像，1-群组头像，2-其他文件")
    private Integer type;

    @Schema(requiredMode = NOT_REQUIRED, description = "上传群组头像时，本字段需设置为群组ID")
    @Nullable
    private Long tid;

    @Schema(requiredMode = REQUIRED, description = "上传的文件内容数据")
    @NotNull(message = "上传文件内容不能为null")
    private MultipartFile file;
}